/*
    Kelompok    2
    Kelas       2
    Anggota :
    1. Yudha Wastu Prawira      / 13509002
    2. Robertus Theodore        / 13509008
    3. Rendy Bambang Junior     / 13509036
    4. Hartono Sulaiman Wijaya  / 13509046
    5. Daniel Prihartoni        / 13509088
    6. Raydhitya Yosep          / 13509092

*/

#include <iostream>
#include <time.h>
#include "App.h"
#include "Resource.h"
#include "MenuState.h"
#include <windows.h>

using namespace std;
int main(){
	//set screen window buffer size
    system("MODE 59,70");
    PlaySound(TEXT("Harvestmoon.wav"), NULL, /*SND_FILENAME|*/SND_LOOP|SND_ASYNC);
	//Inisialisasi singleton
	Resource::instance() -> initialize();

	//Inisialisasi aplikasi dan global variabel
	App app;
	app.initialize();
	p_App = &app;

	//Pilih state yang pertama, tambahkan ke stack state app
	app.addState(new MenuState());
	//Jalankan aplikasi
	do{
		app.update();
	} while (!app.endOfApp);

	//pesan closing dan effect delay
	cout << endl << endl << "Closing";
	cout << ".";
	for(int i = 0; i < 2; i++){
		cout << ".";
		app.delay(1);
	}
	return 0;
}
